<script lang="ts" setup>
import { useProjectStore } from '@/store/modules/project';

const projectStore = useProjectStore();
</script>

<template>
  <div class="header">
    <div class="title">{{ projectStore.currentProject?.name }}</div>
    <div v-if="$slots.left || $slots.default" class="btn1">
      <slot name="left"></slot>
    </div>
    <div v-if="$slots.right || $slots.default" class="btn2">
      <slot name="right"></slot>
    </div>

    <div v-if="$slots.prefix" class="prefix">
      <slot name="prefix"></slot>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.header {
  position: relative;
  .prefix {
    position: absolute;
    top: 0;
    left: 60px;
    text-align: center;
    line-height: 80px;
    font-size: 18px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0px 1px 6px rgba(119, 169, 255, 0.5);
    letter-spacing: 1px;
  }

  .title {
    text-align: center;
    line-height: 60px;
    font-size: 20px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0px 1px 6px rgba(119, 169, 255, 0.5);
    letter-spacing: 1px;
  }
  background: url('@/assets/imgs/index_header.png') no-repeat center;
  background-size: 100% 100%;
  position: relative;
  height: 220px;

  .btn1 {
    background: url('@/assets/imgs/btn1.png') no-repeat center;
    position: absolute;
    left: 21%;
    top: 9px;
    color: #fff;
    width: 244px;
    height: 68px;
    text-align: center;
    line-height: 56px;
    font-size: 18px;
    cursor: pointer;
    ::v-deep {
      span {
        margin-left: 20px;
      }
    }
  }

  .btn2 {
    background: url('@/assets/imgs/btn2.png') no-repeat center;
    position: absolute;
    right: 21%;
    top: 9px;
    color: #fff;
    width: 244px;
    text-align: center;
    height: 68px;
    line-height: 56px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    ::v-deep {
      span {
        margin-right: 30px;
      }
    }
  }
}
</style>
